import request from "@/utils/request";

// 查询补贴规则列表
export function listRule(query) {
  return request({
    url: "/mall/subRule/list",
    method: "get",
    params: query,
  });
}

// 查询补贴规则详细
export function getRule(id) {
  return request({
    url: "/mall/subRule/" + id,
    method: "get",
  });
}

// 新增补贴规则
export function addRule(data) {
  return request({
    url: "/mall/subRule",
    method: "post",
    data: data,
  });
}

// 修改补贴规则
export function updateRule(data) {
  return request({
    url: "/mall/subRule",
    method: "put",
    data: data,
  });
}

// 删除补贴规则
export function delRule(id) {
  return request({
    url: "/mall/subRule/" + id,
    method: "delete",
  });
}
//开关

export function changeOnSale(data) {
  return request({
    url: "/mall/subRule/updateIsOnSale",
    method: "put",
    data,
  });
}
